package com.huadao.cart_ccs.greendao.entity;

import android.support.annotation.IntDef;
import android.support.annotation.StringDef;

import com.huadao.cart_ccs.common.ExperimentStageManager;
import com.huadao.cart_ccs.common.ProjectManager;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Date;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Keep;

/**
 * 人工操作
 */

@Entity
public class Operation {
    @Id
    private Long operationId;
    private long projectId;
    private long stageId;

    private String name;
    private String data;
    private Date dateTime;
    private String operator;

    public static final String Operate_Sample="取样";
    public static final String Operate_Inject="进样";
    public static final String Operate_FluidIntake="进液";
    public static final String Operate_Discharge="排液";
    public static final String Operate_ChangeLiquid="换液";
    public static final String Operate_Collect="收集";
    public static final String Operate_ChangeAir="换气";
    public static final String Operate_Sterilization="杀菌";
    public static final String Operate_Door="电子门";
    public static final String Operate_CleanPipes="清洗管路";
    public static final String Operate_AddCell="添加细胞";
    public static final String Operate_AddViruses="添加病毒";
    public static final String Operate_Circling="循环液体";
    public static final String Operate_AddCryoprotectant="添加冻存保护剂";

    @StringDef({Operate_Sample, Operate_Inject,Operate_FluidIntake,Operate_Discharge,Operate_ChangeLiquid,Operate_Collect,Operate_ChangeAir,Operate_Sterilization,Operate_Door,Operate_CleanPipes,Operate_AddCell,Operate_AddViruses,Operate_Circling,Operate_AddCryoprotectant})
    @Retention(RetentionPolicy.SOURCE)
    public @interface Operate {
    }

    @Keep
    public Operation() {
        this.projectId=ProjectManager.getInstance().getProjectId();
        this.stageId=ExperimentStageManager.getInstance().getStageId();
    }

    @Generated(hash = 68095199)
    public Operation(Long operationId, long projectId, long stageId, String name,
            String data, Date dateTime, String operator) {
        this.operationId = operationId;
        this.projectId = projectId;
        this.stageId = stageId;
        this.name = name;
        this.data = data;
        this.dateTime = dateTime;
        this.operator = operator;
    }

    public Long getOperationId() {
        return this.operationId;
    }
    public void setOperationId(Long operationId) {
        this.operationId = operationId;
    }
    public long getProjectId() {
        return this.projectId;
    }
    public void setProjectId(long projectId) {
        this.projectId = projectId;
    }
    public long getStageId() {
        return this.stageId;
    }
    public void setStageId(long stageId) {
        this.stageId = stageId;
    }
    public String getName() {
        return this.name;
    }
    public void setName(@Operate String name) {
        this.name = name;
    }
    public String getData() {
        return this.data;
    }
    public void setData(String data) {
        this.data = data;
    }
    public String getOperator() {
        return this.operator;
    }
    public void setOperator(String operator) {
        this.operator = operator;
    }
    public Date getDateTime() {
        return this.dateTime;
    }
    public void setDateTime(Date dateTime) {
        this.dateTime = dateTime;
    }

    @Override
    public String toString() {
        return "Operation{" +
                "operationId=" + operationId +
                ", projectId=" + projectId +
                ", stageId=" + stageId +
                ", name='" + name + '\'' +
                ", data='" + data + '\'' +
                ", dateTime=" + dateTime +
                ", operator='" + operator + '\'' +
                '}';
    }
}
